$(function () {
    // $("#page").load("/html/frontPage.html");
    let id = localStorage.getItem("typeId");
    console.log(id);
    findAll(id, 1)
});

function findAll(id, page) {
    // let shuju={
    //     id:id,
    //     temp:temp;
    // }
    let result = myAjax('/getNewsList', 'get', {id: id, page: page});
    let data = result.list;
    let pageCount = Math.ceil(result.number / 10);//总页数
    console.log(id + "x " + pageCount);
    let html = "";
    for (let i = 0; i < data.length; i++) {
        html += ' <li  class="text-list">\n' +
            '                    <div>\n' +
            '                        <div class="first-style">\n' +
            '                            <div>▷</div>\n' +
            '                            <div onclick="conversion()">[' + data[i].newsType + ']</div>\n' +
            '                        </div>\n' +
            '                        <div onclick="jumpNewsDetails(' + data[i].id + ')">' + data[i].newsTitle + '</div>\n' +
            '                    </div>\n' +
            '                    <div>' + data[i].releaseTime + '</div>\n' +
            '                </li>';
    }
    aa(pageCount, page);
    $("#setNewsData").html(html);
    // localStorage.setItem("typeId",'4');
}

// function getHotelNews() {
//  let result = myAjax('/getHotelNews','get',{})
// }
// function getIndustryNews() {}
function conversion() {
    location.assign("/html/news.html");
}

function jumpNewsDetails(id) {
    localStorage.setItem("newsId", id);
    window.open("/html/newsDetails.html");
}